Integrand size = 26, antiderivative size = 120 \[ \int \cos ^2(c+d x) \sqrt {a+i a \tan (c+d x)} \, dx=-\frac {3 i \sqrt {a} \text {arctanh}\left (\frac {\sqrt {a+i a \tan (c+d x)}}{\sqrt {2} \sqrt {a}}\right )}{4 \sqrt {2} d}+\frac {3 i a}{4 d \sqrt {a+i a \tan (c+d x)}}-\frac {i a^2}{2 d (a-i a \tan (c+d x)) \sqrt {a+i a \tan (c+d x)}} \]
[Out]
Time = 0.12 (sec) , antiderivative size = 120, normalized size of antiderivative = 1.00, number of steps used = 5, number of rules used = 5, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.192, Rules used = {3568, 44, 53, 65, 212} \[ \int \cos ^2(c+d x) \sqrt {a+i a \tan (c+d x)} \, dx=-\frac {i a^2}{2 d (a-i a \tan (c+d x)) \sqrt {a+i a \tan (c+d x)}}-\frac {3 i \sqrt {a} \text {arctanh}\left (\frac {\sqrt {a+i a \tan (c+d x)}}{\sqrt {2} \sqrt {a}}\right )}{4 \sqrt {2} d}+\frac {3 i a}{4 d \sqrt {a+i a \tan (c+d x)}} \]
[In]
[Out]
Rule 44
Rule 53
Rule 65
Rule 212
Rule 3568
Rubi steps \begin{align*} \text {integral}& = -\frac {\left (i a^3\right ) \text {Subst}\left (\int \frac {1}{(a-x)^2 (a+x)^{3/2}} \, dx,x,i a \tan (c+d x)\right )}{d} \\ & = -\frac {i a^2}{2 d (a-i a \tan (c+d x)) \sqrt {a+i a \tan (c+d x)}}-\frac {\left (3 i a^2\right ) \text {Subst}\left (\int \frac {1}{(a-x) (a+x)^{3/2}} \, dx,x,i a \tan (c+d x)\right )}{4 d} \\ & = \frac {3 i a}{4 d \sqrt {a+i a \tan (c+d x)}}-\frac {i a^2}{2 d (a-i a \tan (c+d x)) \sqrt {a+i a \tan (c+d x)}}-\frac {(3 i a) \text {Subst}\left (\int \frac {1}{(a-x) \sqrt {a+x}} \, dx,x,i a \tan (c+d x)\right )}{8 d} \\ & = \frac {3 i a}{4 d \sqrt {a+i a \tan (c+d x)}}-\frac {i a^2}{2 d (a-i a \tan (c+d x)) \sqrt {a+i a \tan (c+d x)}}-\frac {(3 i a) \text {Subst}\left (\int \frac {1}{2 a-x^2} \, dx,x,\sqrt {a+i a \tan (c+d x)}\right )}{4 d} \\ & = -\frac {3 i \sqrt {a} \text {arctanh}\left (\frac {\sqrt {a+i a \tan (c+d x)}}{\sqrt {2} \sqrt {a}}\right )}{4 \sqrt {2} d}+\frac {3 i a}{4 d \sqrt {a+i a \tan (c+d x)}}-\frac {i a^2}{2 d (a-i a \tan (c+d x)) \sqrt {a+i a \tan (c+d x)}} \\ \end{align*}
Result contains higher order function than in optimal. Order 5 vs. order 3 in optimal.
Time = 0.11 (sec) , antiderivative size = 51, normalized size of antiderivative = 0.42 \[ \int \cos ^2(c+d x) \sqrt {a+i a \tan (c+d x)} \, dx=\frac {i a \operatorname {Hypergeometric2F1}\left (-\frac {1}{2},2,\frac {1}{2},\frac {1}{2} (1+i \tan (c+d x))\right )}{2 d \sqrt {a+i a \tan (c+d x)}} \]
[In]
[Out]
Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 383 vs. \(2 (94 ) = 188\).
Time = 38.56 (sec) , antiderivative size = 384, normalized size of antiderivative = 3.20
method | result | size |
default | \(-\frac {i \sqrt {a \left (1+i \tan \left (d x +c \right )\right )}\, \left (3 i \sqrt {-\frac {\cos \left (d x +c \right )}{\cos \left (d x +c \right )+1}}\, \operatorname {arctanh}\left (\frac {\sin \left (d x +c \right )}{\left (\cos \left (d x +c \right )+1\right ) \sqrt {-\frac {\cos \left (d x +c \right )}{\cos \left (d x +c \right )+1}}}\right ) \cos \left (d x +c \right )+3 i \sqrt {-\frac {\cos \left (d x +c \right )}{\cos \left (d x +c \right )+1}}\, \arctan \left (\sqrt {-\frac {\cos \left (d x +c \right )}{\cos \left (d x +c \right )+1}}\right ) \sin \left (d x +c \right )+3 i \sqrt {-\frac {\cos \left (d x +c \right )}{\cos \left (d x +c \right )+1}}\, \operatorname {arctanh}\left (\frac {\sin \left (d x +c \right )}{\left (\cos \left (d x +c \right )+1\right ) \sqrt {-\frac {\cos \left (d x +c \right )}{\cos \left (d x +c \right )+1}}}\right )+6 i \cos \left (d x +c \right ) \sin \left (d x +c \right )+3 \sqrt {-\frac {\cos \left (d x +c \right )}{\cos \left (d x +c \right )+1}}\, \operatorname {arctanh}\left (\frac {\sin \left (d x +c \right )}{\left (\cos \left (d x +c \right )+1\right ) \sqrt {-\frac {\cos \left (d x +c \right )}{\cos \left (d x +c \right )+1}}}\right ) \sin \left (d x +c \right )-3 \sqrt {-\frac {\cos \left (d x +c \right )}{\cos \left (d x +c \right )+1}}\, \arctan \left (\sqrt {-\frac {\cos \left (d x +c \right )}{\cos \left (d x +c \right )+1}}\right ) \cos \left (d x +c \right )-3 \sqrt {-\frac {\cos \left (d x +c \right )}{\cos \left (d x +c \right )+1}}\, \arctan \left (\sqrt {-\frac {\cos \left (d x +c \right )}{\cos \left (d x +c \right )+1}}\right )-2 \left (\cos ^{2}\left (d x +c \right )\right )\right )}{8 d}\) | \(384\) |
[In]
[Out]
Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 253 vs. \(2 (87) = 174\).
Time = 0.25 (sec) , antiderivative size = 253, normalized size of antiderivative = 2.11 \[ \int \cos ^2(c+d x) \sqrt {a+i a \tan (c+d x)} \, dx=-\frac {{\left (3 \, \sqrt {\frac {1}{2}} d \sqrt {-\frac {a}{d^{2}}} e^{\left (i \, d x + i \, c\right )} \log \left (-4 \, {\left (\sqrt {2} \sqrt {\frac {1}{2}} {\left (i \, d e^{\left (2 i \, d x + 2 i \, c\right )} + i \, d\right )} \sqrt {\frac {a}{e^{\left (2 i \, d x + 2 i \, c\right )} + 1}} \sqrt {-\frac {a}{d^{2}}} - a e^{\left (i \, d x + i \, c\right )}\right )} e^{\left (-i \, d x - i \, c\right )}\right ) - 3 \, \sqrt {\frac {1}{2}} d \sqrt {-\frac {a}{d^{2}}} e^{\left (i \, d x + i \, c\right )} \log \left (-4 \, {\left (\sqrt {2} \sqrt {\frac {1}{2}} {\left (-i \, d e^{\left (2 i \, d x + 2 i \, c\right )} - i \, d\right )} \sqrt {\frac {a}{e^{\left (2 i \, d x + 2 i \, c\right )} + 1}} \sqrt {-\frac {a}{d^{2}}} - a e^{\left (i \, d x + i \, c\right )}\right )} e^{\left (-i \, d x - i \, c\right )}\right ) - \sqrt {2} \sqrt {\frac {a}{e^{\left (2 i \, d x + 2 i \, c\right )} + 1}} {\left (-i \, e^{\left (4 i \, d x + 4 i \, c\right )} + i \, e^{\left (2 i \, d x + 2 i \, c\right )} + 2 i\right )}\right )} e^{\left (-i \, d x - i \, c\right )}}{8 \, d} \]
[In]
[Out]
\[ \int \cos ^2(c+d x) \sqrt {a+i a \tan (c+d x)} \, dx=\int \sqrt {i a \left (\tan {\left (c + d x \right )} - i\right )} \cos ^{2}{\left (c + d x \right )}\, dx \]
[In]
[Out]
none
Time = 0.31 (sec) , antiderivative size = 122, normalized size of antiderivative = 1.02 \[ \int \cos ^2(c+d x) \sqrt {a+i a \tan (c+d x)} \, dx=\frac {i \, {\left (3 \, \sqrt {2} a^{\frac {3}{2}} \log \left (-\frac {\sqrt {2} \sqrt {a} - \sqrt {i \, a \tan \left (d x + c\right ) + a}}{\sqrt {2} \sqrt {a} + \sqrt {i \, a \tan \left (d x + c\right ) + a}}\right ) + \frac {4 \, {\left (3 \, {\left (i \, a \tan \left (d x + c\right ) + a\right )} a^{2} - 4 \, a^{3}\right )}}{{\left (i \, a \tan \left (d x + c\right ) + a\right )}^{\frac {3}{2}} - 2 \, \sqrt {i \, a \tan \left (d x + c\right ) + a} a}\right )}}{16 \, a d} \]
[In]
[Out]
\[ \int \cos ^2(c+d x) \sqrt {a+i a \tan (c+d x)} \, dx=\int { \sqrt {i \, a \tan \left (d x + c\right ) + a} \cos \left (d x + c\right )^{2} \,d x } \]
[In]
[Out]
Timed out. \[ \int \cos ^2(c+d x) \sqrt {a+i a \tan (c+d x)} \, dx=\int {\cos \left (c+d\,x\right )}^2\,\sqrt {a+a\,\mathrm {tan}\left (c+d\,x\right )\,1{}\mathrm {i}} \,d x \]
[In]
[Out]